
// ReportAnalysisView.h : interface of the CReportAnalysisView class
//


#pragma once

#include "CSpreadSheet.h"
#include "PropertiesWnd.h"
#include <afxcmn.h>

enum EExcelCol
{
	eAccName = 0,
	eAccount,
	eIncome,
	eExpenses,
	eBalance,
	eTime,
	eSourceAccount,
	eSourceAccName,
	eSummary,
};

struct SExcelData
{
	CString strAccName;
	CString strAccount;
	double	dIncome;
	double	dExpenses;
	double	dBalance;
	CString strTime;
	CString strSourceAccount;
	CString strSourceAccName;
	CString strSummary;
	SExcelData()
	{
		dIncome = 0;
		dExpenses = 0;
		dBalance = 0;
	}
};

class CReportAnalysisDoc;

class CReportAnalysisView : public CView
{
protected: // create from serialization only
	CReportAnalysisView();
	DECLARE_DYNCREATE(CReportAnalysisView)

// Attributes
public:
	CReportAnalysisDoc* GetDocument() const;
	BOOL StartAnalysisExcel(SLimitData *pData);
	BOOL CheckFilterData(SExcelData* pExcelData, SLimitData *pData);
// Operations
private:
	SExcelData*		m_pExcelData;
	CListCtrl*		m_pCListCtrl;
// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

protected:
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// Implementation
public:
	virtual ~CReportAnalysisView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	afx_msg void OnFilePrintPreview();
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
};

#ifndef _DEBUG  // debug version in ReportAnalysisView.cpp
inline CReportAnalysisDoc* CReportAnalysisView::GetDocument() const
   { return reinterpret_cast<CReportAnalysisDoc*>(m_pDocument); }
#endif

